package com.comall.dc.banktest.query;

import com.comall.dc.banktest.controller.vo.AccountRecordVO;
import com.comall.dc.banktest.domain.model.AccountRecord;
import com.comall.dc.banktest.infrastructure.dao.service.AccountRecordDAO;
import com.comall.dc.banktest.infrastructure.entity.AccountRecordPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class AccountRecordQuery {


    @Autowired
    private AccountRecordDAO accountRecordDAO;

    /**
     * 根据时段区间、ID查询账户的账目记录
     * @param id 账户ID
     * @param beginTime 开始时间
     * @param endTime 结束时间
     * @return 账户账目记录
     */
    public List<AccountRecordPO> listByAccountIdAndTimeRange(Integer id, LocalDateTime beginTime, LocalDateTime endTime) {
        return accountRecordDAO.listByIdAndTimeRange(id, beginTime, endTime);
    }
}
